package com.hengpeng.itfin.job;

import java.util.Date;

import com.hengpeng.common.cis.ComponentContextLoader;
import com.hengpeng.common.scheduling.AbstractJob;
import com.hengpeng.common.scheduling.ScheduleConfig;
import com.hengpeng.common.util.DateTimeUtil;
import com.hengpeng.itfin.service.BorrowService;

/**
 * 开标截标作业
 * 
 * @author weiyuan
 *
 */
public class BorrowRaiseJob extends AbstractJob {
    @Override
    public void exec(boolean isTimeout, ScheduleConfig config) {
        log.info("开截标任务开始执行,时间：" + DateTimeUtil.formatToStr(new Date(), DateTimeUtil.DATE_FORMAT_YMDHMS));
        BorrowService service = ComponentContextLoader.getBean(BorrowService.class);
        try {
            service.borrowStartRaise();
        } catch (Exception e) {
            log.info("执行开标任务异常", e);
        }
        try {
            service.borrowEndRaise();
        } catch (Exception e) {
            log.info("执行开标任务异常", e);
        }
        log.info("开截标任务结束执行,时间：" + DateTimeUtil.formatToStr(new Date(), DateTimeUtil.DATE_FORMAT_YMDHMS));
    }
}
